<?PHP 
	class Table {
		var $_fields;
		var $_labels;
		function Table($fields,$labels=NULL,$options=NULL){
			$this->_fields = $fields;
			$this->_labels = $labels;
		}
		function render($list){
			$content = "<table>";
			
			$content.= "<tr>";
			for($l=0;$l<count($this->_labels);$l++){
				$content.= "<th>".$this->_labels[$l]."</th>";
			}
			$content.= "</tr>";

			for($l=0;$l<count($list);$l++){
				$content.= "<tr>";
				$temp_rs = $list[$l];
				for($f=0;$f<count($this->_fields);$f++){
					$fieldname = $this->_fields[$f];
					$data = $temp_rs->$fieldname;
					$content.= "<td>".$data."</td>";
				}
				$content.= "</tr>";
			}
			$content.= "</table>";
			return $content;
		}
	}
?>